package com.bdqn.controller;

/**
 * @author 陈昆昆
 * @version 1.0
 * @date 2020/4/9 17:56
 */
import org.apache.shiro.authz.UnauthorizedException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
public class GlobalExceptionHandlerAdvice {

    /**
     * 未授权
     * 程序一旦抛出UnauthorizedException就会触发该方法
     */
    @ExceptionHandler(value= {UnauthorizedException.class})
    public String unauthorized() {
        return "unauthorized";
    }
}